package com.wangdong.rxjavaandroid.javaobserver.demo2;



import java.util.Observable;
import java.util.Observer;

/**
 * 学生 定义为 观察者 继承了java.util.Observer
 */
public class Student$Observer2 implements Observer {

    /**
     * This method is called whenever the observed object is changed. An
     * application calls an <tt>Observable</tt> object's
     * <code>notifyObservers</code> method to have all the object's
     * observers notified of the change.
     *
     * @param o   the observable object.
     * @param arg an argument passed to the <code>notifyObservers</code>
     */
    @Override
    public void update(Observable o, Object arg) {
        System.out.println("老师电话改变了:号码是: "+ ((Teacher$Observable)o).getTeacherNum());
    }
}
